package com.atguigu.lease.common.context;

/**
 * Package: com.atguigu.lease.common.context
 *
 * @Description:
 * @Author xiongkunYang
 * @Create 2025/4/28 10:54
 */
public class LoginUserContext {
    public static final ThreadLocal<LoginUser> LOGIN_USER_THREAD_LOCAL = new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser) {
        LOGIN_USER_THREAD_LOCAL.set(loginUser);
    }

    public static LoginUser getLoginUser() {
        return LOGIN_USER_THREAD_LOCAL.get();
    }
    public static void clear() {
        LOGIN_USER_THREAD_LOCAL.remove();
    }
}